import { UAParser } from "ua-parser-js"

//#region 获取设备信息
export function getDeviceInfo() {
    // 获取当前浏览器的 User-Agent 字符串
    const userAgentString = navigator.userAgent
    // 创建解析器实例
    const parser = new UAParser(userAgentString)
    const device = parser.getResult()
    return {
        browserVersion: device.browser.version,
        browser: device.browser.name,
        osVersion: device.os.version,
        os: device.os.name,
        ua: device.ua,
        device: device.device.type
    }
}
//#endregion
